package com.thermofisher.dsc.amanda.common.crud.controller;

import com.thermofisher.dsc.amanda.model.response.BaseResponse;
import java.util.Map;

public interface BaseController<T> {


    /**
     * for create entity
     *
     * @param entity
     * @return
     */
    BaseResponse insert(T entity);

    /**
     * for update entity
     *
     * @param entity
     * @return
     */
    BaseResponse update(T entity);

    /**
     * for delete entity
     *
     * @param id
     */
    BaseResponse delete(Long id);

    /**
     * for get paging entity data
     *
     * @param params
     * @return
     */
    BaseResponse getList(Map<String, Object> params);

  /**
   * for entity count
   * @param params
   * @return
   */
    default BaseResponse getListCount(Map<String, Object> params) {
        // For backward compatibility
        return null;
    };



    /**
     * for get entity by id
     *
     * @param id
     * @return
     */
    BaseResponse getById(Long id);


}
